In the processing of digitized image data for use in such applications as optical character recognition (OCR) and fingerprint recognition, the image is first digitized and the "object" pixels of the digitized image are separated from the image so that the "object" pixels can be processed.
The term "object pixels" as used in the description of this invention refers to pixels in an image file that represent the "image" to be processed, as opposed to "background." What is considered to be the image will change depending on the application, but the "object" pixels are always defined as the pixels to be separated and processed following separation.
FIG. 2(a) and FIG. 3(a) illustrates two images of printed documents, each containing several Chinese characters, as digitized by an image scanner. In the figures, the pixels representing components of the Chinese characters are defined as "objects" and the rest are "background". In this type of image, the "object" pixels are always those pixels with lower gray levels (darker) and the "background" pixels are those with higher gray levels (lighter). In the most common implementation, the grayness of the pixels is divided into 256 levels, with the "object" pixels considered to be those with gray level of "00" and the "background" pixels defined as those with gray level of "FF."
In the digitization of an image, a CCD (charge coupler device) camera or an image scanner is used to scan the image. The image to be processed sometimes is affixed to an object or a piece of paper. If the object or the paper is scanned under natural illumination conditions, noise will be included in the image data so obtained, as shown in FIGS. 2(a) and 3(a).
The conventional method of determining whether a pixel is a "background" or "object" pixel is to use a constant or static threshold. As shown in FIGS. 2(a) and 3(a), some pixels that should be "background" are represented with a lower gray levels due to the effects of noise, and during processing of the image, are treated as "object" pixels, leading to undesired processing results. Consequently, it is necessary to minimize the number of noise pixels before an image file can be processed so that correct processing may be conducted.
The image data obtained by the CCD camera or an image scanner is treated as a two-dimensional matrix in which each component represents the coordinate and the gray level of a pixel. FIG. 1 shows a rectangular coordinate system suitable for use in the representation of an image file, and in which the original point is at the most upper left corner. If the gray level of the pixel at coordinate (x,y) is g(x,y), the relationship of the gray level of the pixel to the illumination function i(x, y) at the scanning and the reflection function of the medium (the paper or the object) r(x, y) can then be expressed by the following equation: EQU g(x,y)=i(x,y) (1)
In this equation, 0&lt;i(x,y).ltoreq..infin. and 0&lt;r(x,y).ltoreq.1.
Even if the reflection does not create any noise in the gray levels, for example in the case of images printed on a smooth piece of paper with high quality printing, when the images are scanned under natural illumination, the unevenness of the illumination at the time axis may still add a significant amount of noise to the image. FIG. 2(a) and FIG. 3(a) illustrate two images as scanned under natural illumination conditions. The gray levels of pixels at the 180th line from the top of FIG. 2(a) and that of the 120th line from the top of FIG. 3(a) are shown in FIGS. 2(b) and 3(b). As can be seen in the figures, some background pixels have the gray levels far lower (darker) than the average gray level of the background pixels, and thus the gray levels of the "background" pixels vary over a very large scale. If a constant or static threshold is used to decide whether a pixel is object of background, inaccurate results may be expected.
The digital image processing industry is thus in need of a novel method to determine whether a pixel is an object or background pixel when the image to which the pixel belongs is obtained under natural illumination. It is also necessary to provide a dynamic threshold that can determine a pixel to be object or background according to the characteristics of the surrounding pixels.